import request from "@/utils/request";

// 查询部门列表 - 树
export function getDepttree(query) {
  return request({
    url: "/system/dept/treeselect",
    method: "get",
    params: query,
  });
}

// 查询部门列表
export function listDept(query) {
  return request({
    url: "/system/dept/list",
    method: "get",
    params: query,
  });
}

// 查询部门详细
export function getDeptdetail(deptId) {
  return request({
    url: "/system/dept/" + deptId,
    method: "get",
  });
}

// 停用部门
export function getDeptdisable(params) {
  return request({
    url: "/system/dept/dept/disable",
    method: "get",
    params,
  });
}

// 启用部门
export function getDeptenable(params) {
  return request({
    url: "/system/dept/dept/enable",
    method: "get",
    params,
  });
}

// 删除部门
export function delDept(deptId) {
  return request({
    url: "/system/dept/" + deptId,
    method: "delete",
  });
}

// 新增部门
export function addDept(data) {
  return request({
    url: "/system/dept/add",
    method: "post",
    data,
  });
}

// 修改部门名称
export function editDeptname(params) {
  return request({
    url: "/system/dept/set/deptname",
    method: "get",
    params,
  });
}

// 设置主管部门
export function setManagedept(params) {
  return request({
    url: "/system/dept/set/managedept",
    method: "get",
    params,
  });
}
